package demo09;

import java.util.Objects;

public class Person {
    public String id;

    public Person(String id) {
        this.id = id;
    }
    public boolean equals(Object obj){
        Person temp = (Person) obj;
        return temp.id.equals(this.id);
    }
    //重写 hasCode
    public int hasCode(){
        return Objects.hash(id);
    }
    @Override
    public String toString() {
        return "Person{" +
                "id='" + id + '\'' +
                '}';
    }
}
